import User from './path-to-user-model';

async function createUser() {
  const user = await User.create({
    firstName: 'John',
    lastName: 'Doe',
    email: 'john.doe@example.com'
  });
  console.log('User created:', user.toJSON());
}

async function getUser() {
  const user = await User.findByPk(1);
  console.log('User retrieved:', user.toJSON());
}

async function updateUser() {
  const user = await User.findByPk(1);
  user.firstName = 'Jane';
  await user.save();
  console.log('User updated:', user.toJSON());
}

async function deleteUser() {
  const user = await User.findByPk(1);
  await user.destroy();
  console.log('User deleted');
}

// 调用这些函数
createUser();
getUser();
updateUser();
deleteUser();